#include "tabulist.h"
#include "hypersphere.h"


// clears the tabu list after local minimisation
void Tabulist::clear(int tabulistSize)
{
  m_list.clear();
  m_numInList=0;
  whichToOverWrite=0;
  m_list.resize(tabulistSize);
}

// tests the tabu list methods
void Tabulist::test()
{
  vector<double> d;

  d.push_back(3.2);
  d.push_back(5.1);

  Hypersphere h1(d,3.4), h2(d,1.1), h3(d,80.4);

  Tabulist t(3);

  t.add(h1);
  t.add(h2);
  t.add(h3);

  cout << "Is tabu: " << t.isInList(d) << endl;

}

ostream &operator<<(ostream &os, Hypersphere &X)
{
os << X.m_radius << endl;

return ( os );
}